<!-- 基层岗位评分 -->
<template>
	<!-- 返回上一页 -->
	<view class="app-container">
		<view @click="Back()" class="back">
			<uni-icons type="back" size="30rpx" color="#ffffff" style="margin-left: 20rpx;">
				<text style="margin-left: 10rpx;color: #ffffff;">员工双轨制评估</text>
			</uni-icons>
		</view>
		<!-- 评分进度条 -->
		<view class="Progressbar">
			<view style="color: #ffffff;font-size: 24rpx;">姓名：{{caption.name}}</view>
			<view class="p_01">
				<text>
					评分进度
				</text>
				<text>
					<text class="p_01_01">{{current}}</text>/{{all}}
				</text>
			</view>
			<progress :percent=Progress stroke-width="8" activeColor="#ffffff" backgroundColor="#558ffc" />
		</view>

		<!-- 评分框 -->
		<view class="Answer">
			<!-- 目标完成情况 -->
			<view v-if="active==0">
				<view class="title">{{caption.title}}</view>
				<uni-data-checkbox v-model="radio1" :localdata="finish" class="ttt"></uni-data-checkbox>
				
				<view v-if="radio1==1" style="margin-top: 10rpx;">
					<input type="digit" v-model="finish.scores" @blur="strong(finish.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio1==2" style="margin-top: 10rpx;">
					<input type="digit" v-model="finish.scores" @blur="middle(finish.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio1==3" style="margin-top: 10rpx;">
					<input type="digit" v-model="finish.scores" @blur="weak(finish.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
				
			</view>
			<!-- 岗位胜任能力 -->
			<view v-else-if="active==1">
				<view class="title">{{contents[0].title}}</view>
				<view v-for=" (item,index) in Post">
					{{item.text}}
					<input type="digit" class="inputbox" v-model="item.scores" placeholder="评分区间为0-10" @blur="fraction(item.scores,index)" />
				</view>				
			</view>
			
			<!-- 执行力 -->
			<view v-else-if="active==2">
				<view class="title">{{execute[0].title}}</view>
				<uni-data-checkbox  v-model="radio2" :localdata="execute"></uni-data-checkbox>
				
				<view v-if="radio2==7" style="margin-top: 10rpx;">
					<input type="digit" v-model="execute.scores" @blur="strong(execute.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio2==8" style="margin-top: 10rpx;">
					<input type="digit" v-model="execute.scores"  @blur="middle(execute.scores)" class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio2==9" style="margin-top: 10rpx;">
					<input type="digit" v-model="execute.scores" @blur="weak(execute.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
				
			</view>
			
			<!-- 学习力 -->
			<view v-else-if="active==3">
				<view class="title">{{learn[0].title}}</view>
				<uni-data-checkbox  v-model="radio3" :localdata="learn"></uni-data-checkbox>
				
				<view v-if="radio3==10" style="margin-top: 10rpx;">
					<input type="digit" v-model="learn.scores" @blur="strong(learn.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio3==11" style="margin-top: 10rpx;">
					<input type="digit" v-model="learn.scores" @blur="middle(learn.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio3==12" style="margin-top: 10rpx;">
					<input type="digit" v-model="learn.scores" @blur="weak(learn.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
			
			<!-- 贡献度 -->
			<view v-else-if="active==4">
				<view class="title">{{contribute[0].title}}</view>
				<uni-data-checkbox  v-model="radio4" :localdata="contribute"></uni-data-checkbox>
				
					
				<view v-if="radio4==13" style="margin-top: 10rpx;">
					<input type="digit" v-model="contribute.scores" @blur="strong(contribute.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio4==14" style="margin-top: 10rpx;">
					<input type="digit" v-model="contribute.scores"  @blur="middle(contribute.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio4==15" style="margin-top: 10rpx;">
					<input type="digit" v-model="contribute.scores" @blur="weak(contribute.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
			
			<!-- 基本素质 -->
			<view v-else-if="active==5">
				<view class="title">{{diathesis[0].title}}</view>
				<uni-data-checkbox  v-model="radio5" :localdata="diathesis"></uni-data-checkbox>
				
				<view v-if="radio5==16" style="margin-top: 10rpx;">
					<input type="digit" v-model="diathesis.scores" @blur="strong(diathesis.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio5==17" style="margin-top: 10rpx;">
					<input type="digit" v-model="diathesis.scores" @blur="middle(diathesis.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio5==18" style="margin-top: 10rpx;">
					<input type="digit" v-model="diathesis.scores" @blur="weak(diathesis.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
			
			<!-- 责任心 -->
			<view v-else-if="active==6">
				<view class="title">{{responsibility[0].title}}</view>
				<uni-data-checkbox  v-model="radio6" :localdata="responsibility"></uni-data-checkbox>
				
				<view v-if="radio6==19" style="margin-top: 10rpx;">
					<input type="digit" v-model="responsibility.scores" @blur="strong(responsibility.scores)"  class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio6==20" style="margin-top: 10rpx;">
					<input type="digit" v-model="responsibility.scores" @blur="middle(responsibility.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio6==21" style="margin-top: 10rpx;">
					<input type="digit" v-model="responsibility.scores" @blur="weak(responsibility.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
			
			<!-- 进取心 -->
			<view v-else-if="active==7">
				<view class="title">{{enterprise[0].title}}</view>
				<uni-data-checkbox  v-model="radio7" :localdata="enterprise"></uni-data-checkbox>
				
				<view v-if="radio7==22" style="margin-top: 10rpx;">
					<input type="digit" v-model="enterprise.scores"  @blur="strong(enterprise.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio7==23" style="margin-top: 10rpx;">
					<input type="digit" v-model="enterprise.scores" @blur="middle(enterprise.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio7==24" style="margin-top: 10rpx;">
					<input type="digit" v-model="enterprise.scores" @blur="weak(enterprise.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
			
			<!-- 协作配合-->
			<view v-else-if="active==8">
				<view class="title">{{collaboration[0].title}}</view>
				<uni-data-checkbox  v-model="radio8" :localdata="collaboration"></uni-data-checkbox>
				
				<view v-if="radio8==25" style="margin-top: 10rpx;">
					<input type="digit" v-model="collaboration.scores" @blur="strong(collaboration.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio8==26" style="margin-top: 10rpx;">
					<input type="digit" v-model="collaboration.scores" @blur="middle(collaboration.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio8==27" style="margin-top: 10rpx;">
					<input type="digit" v-model="collaboration.scores" @blur="weak(collaboration.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
			
			<!--能量传递-->
			<view v-else-if="active==9">
				<view class="title">{{energy[0].title}}</view>
				<uni-data-checkbox  v-model="radio9" :localdata="energy"></uni-data-checkbox>
				
				<view v-if="radio9==28" style="margin-top: 10rpx;">
					<input type="digit"  v-model="energy.scores" @blur="strong(energy.scores)" class="inputbox" placeholder="评分区间为15-20"/>
				</view>
				<view v-else-if="radio9==29" style="margin-top: 10rpx;">
					<input type="digit" v-model="energy.scores"  @blur="middle(energy.scores)"  class="inputbox" placeholder="评分区间为10-14.9"/>
				</view>
				<view v-else-if="radio9==30" style="margin-top: 10rpx;">
					<input type="digit" v-model="energy.scores" @blur="weak(energy.scores)" class="inputbox"  placeholder="评分区间为0-9.9"/>
				</view>
			</view>
		</view>
		<!-- 答题框下面的层级覆盖效果 -->
		<view class="big"></view>
		<view class="small"></view>

		<view class="anniu">
			<button style="width: 300rpx; color: #0c5ffa;" hover-class="annius" @click="previous()">上一项</button>
			<button style="width: 300rpx;color: #0c5ffa;" hover-class="annius" @click="next()" v-if="an">下一项</button>
			<button style="width: 300rpx;color: #0c5ffa;" hover-class="annius" v-else  @click="submit()">提交</button>
		</view>
	</view>
</template>

<script setup>
import { ref,reactive,watch } from 'vue';
import { selectTopic,insertScore} from '@/api/assess.js'

	const userid = 136

	//定义当前答题进度
	const current =ref(1) 
	//定义总答题数
	const all = 10
	//定义进度条的进度单位是%
	const Progress =ref(11)
	//定义一个返回上一页的方法
	const Back = () => {
		uni.navigateBack({
			delta: 1, //返回层数，2则上上页
		})
	}
	
	
	//下一项的数据
	const active = ref(0)
	//定义提交按钮的盒子
	const an=ref(true)
	
	//强的分值区间
	const strong = (fractions) => {
		if (fractions != "" && (fractions >= 15 && fractions <= 20)) {
		} else {
			uni.showToast({
				title: `根据你当前的选择,请输入${15}-${20}之间的数字`,
				icon: 'none'
			});
			//清除对应的数据
			if(active.value==0){
				finish.value.scores = "";
			}else if(active.value==2){				
				execute.value.scores="";
			}else if(active.value==3){
				learn.value.scores="";
			}else if(active.value==4){
				contribute.value.scores="";
			}else if(active.value==5){
				diathesis.value.scores="";
			}else if(active.value==6){
				responsibility.value.scores="";
			}else if(active.value==7){
				enterprise.value.scores="";
			}else if(active.value==8){
				collaboration.value.scores="";
			}else if(active.value==9){
				energy.value.scores="";
			}
		}		
	};
	//中的分值区间
	const middle = (fractions) => {
		if (fractions != "" && (fractions >= 10 && fractions <= 14.9)) {
		} else {
			uni.showToast({
				title: `根据你当前的选择,请输入${10}-${14.9}之间的数字`,
				icon: 'none'
			});
			//清除对应的数据
			if(active.value==0){
				finish.value.scores = "";
			}else if(active.value==2){				
				execute.value.scores="";
			}else if(active.value==3){
				learn.value.scores="";
			}else if(active.value==4){
				contribute.value.scores="";
			}else if(active.value==5){
				diathesis.value.scores="";
			}else if(active.value==6){
				responsibility.value.scores="";
			}else if(active.value==7){
				enterprise.value.scores="";
			}else if(active.value==8){
				collaboration.value.scores="";
			}else if(active.value==9){
				energy.value.scores="";
			}
		}
	};
	//弱的分值区间
	const weak = (fractions) => {
		if ((fractions >= 0 && fractions <= 9.9) && fractions != "") {
		} else {
			uni.showToast({
				title: `根据你当前的选择,请输入${0}-${9.9}之间的数字`,
				icon: 'none'
			});
			//清除对应的数据
			if(active.value==0){
				finish.value.scores = "";
			}else if(active.value==2){				
				execute.value.scores="";
			}else if(active.value==3){
				learn.value.scores="";
			}else if(active.value==4){
				contribute.value.scores="";
			}else if(active.value==5){
				diathesis.value.scores="";
			}else if(active.value==6){
				responsibility.value.scores="";
			}else if(active.value==7){
				enterprise.value.scores="";
			}else if(active.value==8){
				collaboration.value.scores="";
			}else if(active.value==9){
				energy.value.scores="";
			}
		}
	};
	
	//岗位评分分值区间
	const fraction = (fractions,inputRef) => {
		if (fractions >= 0 && fractions <= 10 && fractions != "") {
		} else {
			uni.showToast({
				title: `请输入${0}-${10}之间的数字`,
				icon: 'none'
			});
			Post.value[inputRef].scores='';
		}
	};
	
// 检查岗位胜任能力的所有评分是否已填写
const isAllScoresFilled = () => {
  return Post.value.every(item => item.scores !== '');
};


	// 下一项
	const next = () => {
	  // 首先进行分值区间的校验
	  let isValid = true;
	  Post.value.forEach(item => {
	    const score = parseFloat(item.scores);
	    if (item.type === 'strong') {
	      strong(score);
	    } else if (item.type === 'middle') {
	      middle(score);
	    } else if (item.type === 'weak') {
	      weak(score);
	    } else if (item.type === 'fraction') {
	      fraction(score);
	    }
	  });
	
	  if (!isValid) {
	    return;
	  }
	  active.value++;
	  // 进度条上面的数字显示
	  current.value = active.value + 1;
	  // 进度条的数据
	  Progress.value = ((current.value / 10).toFixed(2)) * 100;
	  if (active.value === 9) {
	    an.value = false;
	  }else{
			an.value=true;
		}
	};
	
	//上一项
	const previous = () => {
		if(active.value>0){
			active.value--
			//进度条上面的数字显示
			current.value=active.value+1
			//进度条的数据
			Progress.value=((current.value/10).toFixed(2))*100
		}
		if(active.value<=9){
			an.value=true;
		}
	}
	
	//定义存放标题的变量
	const caption=ref({})
	// 选择框选中的id
	const radio1 = ref(0); // 目标完成情况选择项的Id
	const radio2 = ref(0); // 执行力选择项的Id
	const radio3 = ref(0); // 学习力选择项的Id
	const radio4 = ref(0); // 贡献度选择项的Id
	const radio5 = ref(0); // 基本素质选择项的Id
	const radio6 = ref(0); // 责任心选择项的Id
	const radio7 = ref(0); // 进取心选择项的Id
	const radio8 = ref(0); // 协作配合选择项的Id
	const radio9 = ref(0); // 能量传递选择项的Id

	// 存放目标完成情况的题
	const finish = ref([]);
	//存放岗位胜任能力标题的
	const contents=ref([]);
	// 存放执行力的题
	const execute = ref([]);
	// 存放学习力的题目
	const learn = ref([]);
	// 存放贡献度的题目
	const contribute = ref([]);
	// 存放基本素质的题目
	const diathesis = ref([]);
	// 存放责任心
	const responsibility = ref([]);
	// 存放进取心的题目
	const enterprise = ref([]);
	// 存放协作配合的题目
	const collaboration = ref([]);
	// 存放能量传递的题目
	const energy = ref([]);
	// 存放岗位胜任能力的题目
	const Post = ref([]);

	// 存放不同类别的题目的数组 数字对应是是category_Id
	const categoryArrays = {
		2: finish,
		3:contents,
		4: execute,
		5: learn,
		6: contribute,
		8: diathesis,
		9: responsibility,
		10: enterprise,
		11: collaboration,
		12: energy,
		23: Post,
		24: Post,
		25: Post,
		26: Post,
		27: Post,
		28: Post,
	};

	// 获取题库的方法
	const getTopic = (userid) => {
		selectTopic(userid).then(res => {
		  data.value = res.rows;
		
		  // 初始化每个数组
		  Object.values(categoryArrays).forEach(array => array.value = []);
		  // 存放题目
		  data.value.forEach((shu) => {
		    const targetArray = categoryArrays[shu.category_Id];
		    if (targetArray) {
		      targetArray.value.push({
		        text: shu.content_Name,
		        value: shu.content_Id,
		        scores: '',
		        title: shu.category_Name
		      });
		    }
		  });
		 caption.value.title= finish.value[0].title
		 caption.value.name = data.value[0].nick_name
		});
	};

	// 题库数据
	const data = ref([]);
	
	var uscore = ref({
	  userid: "",
	  assessDate: "",
	  userscore: []
	});
	
	//计算岗位能力的算法方法
	const capacityscore = () => {
	  var sum = 0;
	  for (var i = 0; i <Post.value.length; i++) {
	
	    sum = sum + Number(Post.value[i].scores);
	    sum = parseFloat(sum);
	  }
	  const outcome = (sum * 0.2).toFixed(2);
	
	  if (outcome <= 20 && outcome >= 15) {
	    uscore.value.userscore[1].score = outcome;
	  } else if (outcome < 15 && outcome >= 10) {
	    uscore.value.userscore[1].score = outcome;
	  } else if (outcome < 10 && outcome >= 0) {
	    uscore.value.userscore[1].score = outcome;
	  }
	};
	
	//存放能力的评分总分
	const ability=ref(0);
	//存放潜力的评分总分
	const potential=ref(0);
	
	const bind = () => {
	  // 确保 uscore.value.userscore 数组有足够的长度
	  if (uscore.value.userscore.length < 10 + Post.value.length) {
	    uscore.value.userscore = Array.from({ length: 10 + Post.value.length }, () => ({ category_Id: '', score: '' }));
	  }
	  
	  // 绑定各个评分项的 category_Id 和 score
	  uscore.value.userscore[0].category_Id = radio1.value;
	  uscore.value.userscore[0].score=finish.value.scores;
	  
	  
	  uscore.value.userscore[1].category_Id = "";
	  
	  uscore.value.userscore[2].category_Id = radio2.value;
	  uscore.value.userscore[2].score=execute.value.scores;
	  
	  uscore.value.userscore[3].category_Id = radio3.value;
	  uscore.value.userscore[3].score=learn.value.scores;
	  
	  uscore.value.userscore[4].category_Id = radio4.value;
	  uscore.value.userscore[4].score=contribute.value.scores;
	  
	  uscore.value.userscore[5].category_Id = radio5.value;
	  uscore.value.userscore[5].score=diathesis.value.scores;
	  
	  uscore.value.userscore[6].category_Id = radio6.value;
	  uscore.value.userscore[6].score=responsibility.value.scores;
	  
	  uscore.value.userscore[7].category_Id = radio7.value;
	  uscore.value.userscore[7].score = enterprise.value.scores;
	  
	  uscore.value.userscore[8].category_Id = radio8.value;
	  uscore.value.userscore[8].score = collaboration.value.scores;
	  
	  uscore.value.userscore[9].category_Id = radio9.value;
	  uscore.value.userscore[9].score = energy.value.scores;
	
	  // 处理岗位胜任能力的评分项
	  Post.value.forEach((item, index) => {
	    uscore.value.userscore[10 + index].category_Id = item.value;
	    uscore.value.userscore[10 + index].score = item.scores;
	  });
	  capacityscore();
	};
	
	//计算能力和潜力的评分
	const itemscoring = () => {
		let sum = 0;
		for (let i = 0; i < 5; i++) {
			sum += parseFloat(uscore.value.userscore[i].score || 0); // 确保 score 是数值类型
		}
		ability.value = sum;

		let sum1 = 0;
		for (let i = 5; i <= 9; i++) {
			sum1 += parseFloat(uscore.value.userscore[i].score || 0); // 确保 score 是数值类型
		}
		potential.value = sum1;
	};
	
	// 提交按钮
	const submit = () => {
		//先走存入的方法
	    bind();
	    itemscoring();
	
	    // 检查是否有空的分数
	    let hasEmptyScore = false;
	    // 定义一个集合来记录具体的提示信息，避免重复
	    const messagesSet = new Set();
	
	    // 开始遍历分数是否有空分数
	    uscore.value.userscore.forEach((item, index) => {
	        if (item.score === '' || item.score === null) {
	            hasEmptyScore = true;
	            if (index >= 0 && index < 10) {
	                messagesSet.add(`${getCategoryName(index)} ;`);
	            } else if (index >= 10) {
	                messagesSet.add(`岗位胜任能力;`);
	            }
	        }
	    });
	
	    // 检查是否有未选择的选项
	    const radioChecks = [radio1, radio2, radio3, radio4, radio5, radio6, radio7, radio8, radio9];
	    radioChecks.forEach((radio, index) => {
	        if (radio.value === 0) { // 假设0表示未选择
	            hasEmptyScore = true;
	            messagesSet.add(` ${getCategoryName(index * 2)} ;`);
	        }
	    });
	
	    if (hasEmptyScore) {
	        // 将集合转换为数组并用换行符连接
	        const messages = Array.from(messagesSet).join('\n');
	        // 使用uni.showModal来显示具体的评分项没有评分
			uni.showModal({
				title: '未评分',      
				content: messages,
				showCancel: false, // 不显示取消按钮
				success: function (res) {
					if (res.confirm) {
						console.log('用户点击了确定');
					}
				}
			});
	
	        // 打印所有未填项的提示信息到控制台（可选）
	        console.log(messages);
	    } else {
	        // 如果没有空的分数，显示确认提交弹窗
	        uni.showModal({
	            title: '提示',
	            content: '是否确认提交？',
	            success: function (res) {
	                if (res.confirm) {
	                    // 用户点击确认
	                    insertScore(uscore.value).then(result => {
	                        console.log(result);
	                        if (result === 1) {
	                            uscore.value = null;
	                            console.log(uscore.value);
	                            uni.showToast({
	                                title: '评价完成',
	                                icon: 'success',
	                                duration: 5000
	                            });
	                            uni.navigateTo({
	                                url: `/pages/check/complete/complete?ability=${ability.value}&potential=${potential.value}` // 跳转到评分完成页面
	                            });
	                        } else if (result === 0) {
	                            uni.showToast({
	                                title: '系统异常',
	                                icon: 'none'
	                            });
	                        } else if (result == 2) {
	                            uni.showToast({
	                                title: '正在提交',
	                                icon: 'none'
	                            });
	                        }
	                    }).catch(error => {
	                        console.error('插入分数时发生错误:', error);
	                        uni.showToast({
	                            title: '系统异常',
	                            icon: 'none'
	                        });
	                    });
	                } else if (res.cancel) {
	                    // 用户点击取消
	                    uni.showToast({
	                        title: '已取消',
	                        icon: 'none'
	                    });
	                }
	            }
	        });
	    }
	};
	
	// 获取类别名称(未填写的)
	const getCategoryName = (index) => {
	  switch (index) {
	    case 0:
	      return '目标完成情况';
	    case 2:
	      return '执行力';
	    case 3:
	      return '学习力';
	    case 4:
	      return '贡献度';
	    case 5:
	      return '基本素质';
	    case 6:
	      return '责任心';
	    case 7:
	      return '进取心';
	    case 8:
	      return '协作配合';
	    case 9:
	      return '能量传递';
	    default:
	      return '';
	  }
	};
	
	// 获取类别名称(未选择的)
	const getCategoryName1 = (index) => {
	  switch (index) {
	    case 0:
	      return '目标完成情况';
	    case 2:
	      return '执行力';
	    case 4:
	      return '学习力';
	    case 6:
	      return '贡献度';
	    case 8:
	      return '基本素质';
	    case 10:
	      return '责任心';
	    case 12:
	      return '进取心';
	    case 14:
	      return '协作配合';
	    case 16:
	      return '能量传递';
	    default:
	      return '';
	  }
	};
	
	
	//设置监听器，如果选项的id变换，将本项的分值清空
	//监听器1
	watch(
	  () => radio1.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      finish.value.scores = "";
	    }
	  }
	);
	//监听器2
	watch(
	  () => radio2.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      execute.value.scores = "";
	    }
	  }
	);
	//监听器3
	watch(
	  () => radio3.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      learn.value.scores = "";
	    }
	  }
	);
	//监听器4
	watch(
	  () => radio4.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      contribute.value.scores = "";
	    }
	  }
	);
	//监听器5
	watch(
	  () => radio5.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      diathesis.value.scores = "";
	    }
	  }
	);
	//监听器6
	watch(
	  () => radio6.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      responsibility.value.scores = "";
	    }
	  }
	);
	//监听器7
	watch(
	  () => radio7.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	     enterprise.value.scores = "";
	    }
	  }
	);
	//监听器8
	watch(
	  () => radio8.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      collaboration.value.scores = "";
	    }
	  }
	);
	//监听器9
	watch(
	  () => radio9.value,
	  (newVal, oldVal) => {
	    if (newVal != oldVal) {
	      energy.value.scores = "";
	    }
	  }
	);
	
	// onload方法
	onLoad((xin) => {
		//将页面传过来的用户id和评分日期存放到uscore里面
		uscore.value.userid=xin.userId;
		uscore.value.assessDate=xin.assessDate
		getTopic(xin.userId);
	});
</script>

<style lang="scss" scoped>

	
	//所有盒子的父类
	.app-container {
		width: 100%;
		height: 100vh;
		overflow: auto;
		background-color: #0c5ffa;
		border: 1px solid #0c5ffa;

		.back {
			margin-top: 100rpx;
			color: white;
		}

		// 进度条的样式
		.Progressbar {
			width: 94%;
			margin-top: 50rpx;
			margin-left: 20rpx;

			.p_01 {
				color: #84aefd;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				font-size: 26rpx;
				margin-top: 20rpx;
				.p_01_01 {
					font-size: 32rpx;
					color: #ffffff;
				}
			}
		}

		//答题框
		.Answer {
			
			width: 80%;
			margin: 0 auto;
			margin-top: 60rpx;
			background-color: #ffffff;
			min-height: 40vh;
			padding:25px;
			border-radius: 10rpx;
			// 定义相对定位
			position: relative;
			//定义层级等级
			z-index: 3;

			.topic {
				color: #ffffff;
				font-size: 30rpx;
				margin-left: 10rpx;
				margin-top: -70rpx;
				padding-left: 10rpx;
				padding-bottom: 3rpx;
				background-color: #0c5ffa;
				width: 28%;
				border-radius: 5rpx;
			}
			.inputbox{
				border: 1px solid #c5c5c5;
				width: 500rpx;
				height: 60rpx;			
				margin: 10px 0 15px;
				padding-left: 10px;
				position: relative;  //定义一个相对定位不要删，否则输入框数字会在滑动的时候一起滑动
			}
		
		}
		.title{
			width: 230rpx;
			background-color: #0c5ffa;
			color: #ffffff;
			height: 40rpx;
			padding: 10rpx 0;
			text-align: center;
			margin-bottom: 20rpx;
			border-radius: 6rpx;
		
			
		}
		.title_item{
				font-size: 14px;
		}

		// 答题框下面的第一层
		.big {
			width: 86%;
			margin-left: 50rpx;
			height: 40vh;
			background-color: #ffffff;
			margin-top: -38vh;
			//定义透明度
			opacity: 0.6;
			//定义层级等级
			z-index: 2;
			border-radius: 10rpx;
		}

		//答题框下面的第二层
		.small {
			//定义层级等级
			z-index: 1;
			width: 78%;
			height: 40vh;
			margin-left: 80rpx;
			background-color: #f3f3f3;
			margin-top: -38vh;
			//定义透明度
			opacity: 0.6;
			border-radius: 10rpx;
		}


		.anniu {
			width: 100%;
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			margin: 100rpx 0 50rpx 0;

			.annius {
				background-color: #dcdcdc;
				color: #1e6afa;
			}
		}

	}
</style>